import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    //静态变量：该系统是否显示VIP歌曲？
    showVIP: false, //*
    //播放器的数据
    musicDetail: {
      url: ""
    }
  },
  mutations: {
    updateMusicDetail(state, newMusicDetail) {
      state.musicDetail = newMusicDetail;
      console.log("更新了歌曲播放信息")
      console.log(state.musicDetail)
    },
    updateMusicDetailAtrr(state, params) {
      let name = params[0];
      let value = params[1];
      state.musicDetail[name] = value;
      console.log('歌曲属性更新了')
      console.log(name, value)
    }
  },
  actions: {},
  modules: {}
})